<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        * {
            margin: 0;
            padding: 0;
        }

        /*第一种方法*/
        #one{
            padding-left: 300px;
            width: 100%;
            height: 50px;
            background-color: red;
        }
        #box1{
            float: left;
            background-color: #34ED16;
            width: 100%;
            height: 50px;
        }
        #box2{
            float: left;
            background-color: greenyellow;
            width: 300px;
            height: 50px;
            margin-left: -100%;
            position: relative;
            left: -300px;
        }


        /*第二种方法*/
        .box{
            padding-left: 300px;
            width: 100%;
            height: 50px;
            background-color: rosybrown;
        }
        #box3 {
            width: 300px;
            height: 50px;
            background-color: #3388FF;
            float: left;
            margin-left: -300px;
        }
        #box4 {
            width: 100%;
            height: 50px;
            background-color: forestgreen;
            float: left;
        }

        .diy {
            height: 80px;
            background-color: sandybrown;
            padding-left: 100px;
        }

        #diy1 {
            width: 100px;
            height: 80px;
            background-color: #f0c948;
            float: left;
            margin-left: -100px;
        }
        #diy2 {
            width: 100%;
            height: 80px;
            background-color: hotpink;
            float: left;
        }

        .diyy {
            width: 100%;
            height: 100px;
            background-color: #3388FF;
            padding-left: 200px;
        }
        #diy3 {
            width: 100%;
            height: 100px;
            background-color: lightcoral;
            float: left;
        }
        #diy4 {
            width: 200px;
            height: 100px;
            background-color: springgreen;
            margin-left: -100%;
            float: left;
            left: -200px;
            position: relative;
        }
    </style>
</head>
<body>
    <div id="one" class="box">
        <div id="box1" >box1</div>
        <div id="box2" >box2</div>
    </div>
    <div class="box">
        <div id="box3" >box3</div>
        <div id="box4" >box4</div>
    </div>
    <div class="diy">
        <div id="diy1" >diy1</div>
        <div id="diy2" >diy2</div>
    </div>
    <div class="diyy">
        <div id="diy3" >diy3</div>
        <div id="diy4" >diy4</div>
    </div>
</body>
</html>